function test_script()
    disp('redo testing mme method=1')
    % in, out, t, k, qf, typ, arg
%    run_test('t1k3qf70bpc010', 1, 3, 70, 'bpc', 0.1);
%    run_test('t2k3qf70bpc010', 2, 3, 70, 'bpc', 0.1);%MME2
%    run_test('t3k3qf70bpc010', 3, 3, 70, 'bpc', 0.1);%MME3    
%    run_test('t1k3qf70bpc005', 1, 3, 70, 'bpc', 0.05);
%    run_test('t2k3qf70bpc005', 2, 3, 70, 'bpc', 0.05);%MME2
%    run_test('t3k3qf70bpc005', 3, 3, 70, 'bpc', 0.05);%MME3    

%    run_test('t4k3qf70bpc010', 4, 3, 70, 'bpc', 0.1);%MME4
%    run_test('t4k3qf70bpc005', 4, 3, 70, 'bpc', 0.05);%MME4
%    run_test('t3k3qf50bpc010', 3, 3, 50, 'bpc', 0.1);
%    run_test('t3k3qf100bpc010', 3, 3, 100, 'bpc', 0.1);
end

function test_script3()
    k = 2;
    n = 3;
    assert(isequal(get_value([0 0 0],k,n), get_value2([0 0 0],k,n)));
    assert(isequal(get_value([0 0 1],k,n), get_value2([0 0 1],k,n)));
    assert(isequal(get_value([0 1 0],k,n), get_value2([0 1 0],k,n)));
    assert(isequal(get_value([0 1 1],k,n), get_value2([0 1 1],k,n)));
    assert(isequal(get_value([1 0 0],k,n), get_value2([1 0 0],k,n)));
    assert(isequal(get_value([1 0 1],k,n), get_value2([1 0 1],k,n)));
    assert(isequal(get_value([1 1 0],k,n), get_value2([1 1 0],k,n)));
    assert(isequal(get_value([1 1 1],k,n), get_value2([1 1 1],k,n)));
end

function [c,s,E] = test_script2(fname, qf)
if nargin < 1
    % EASILY DEBUG
    fname = '/media/win_c/image/ucid.v2/ucid00001.tif';
end
if nargin < 2
    qf = 100;
end

img = imread(fname);
if size(img,3) ~= 1
    % suppose it is rgb
    gray_img = rgb2gray(img);
else
    gray_img = img;
end
qtable = jpeg_qtable(qf);

[rc,c,rs,s, o] = get_original_value(gray_img, qtable);
%D0 unchanged
D0 = abs(c - o);
%D1 changed
D1 = abs(s - o);
E = get_LSB_error(s, o);

%% test are put here
[nc, pos, emin] = mme_embedpart([1,0,1],[4,2,1],[5,5,5],[1,0],2,3);
assert(isequal(nc, [1,0,5]),'wrong nc');
assert(isequal(pos, [0,0,1]),'wrong pos');
assert(emin == 1, 'wrong emin');

[nc, pos, emin] = mme_embedpart([1,0,1],[4,2,1],[5,5,5],[1,1],2,3);
assert(isequal(nc, [1,5,5]),'wrong nc');
assert(isequal(pos, [0,1,1]),'wrong pos');
assert(emin == 3, 'wrong emin');

end
